<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('小程序端用户列表')"/>
</head>
<body class="gray-bg">
<div class="container-div">
    <div class="row">
        <div class="col-sm-12 search-collapse">
            <form id="formId">
                <div class="select-list">
                    <ul>

                        <li>
                            <p>姓名：</p>
                            <input type="text" name="realName"/>
                        </li>

                        <li>
                            <p>电话：</p>
                            <input type="text" name="mobile"/>
                        </li>


                        <li>
                            <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i
                                    class="fa fa-search"></i>&nbsp;搜索</a>
                            <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i
                                    class="fa fa-refresh"></i>&nbsp;重置</a>
                        </li>
                    </ul>
                </div>
            </form>
        </div>

        <div class="btn-group-sm" id="toolbar" role="group">
            <a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="system:wcuser:add">
                <i class="fa fa-plus"></i> 添加
            </a>
            <a class="btn btn-primary single disabled" onclick="$.operate.edit()"
               shiro:hasPermission="system:wcuser:edit">
                <i class="fa fa-edit"></i> 修改
            </a>
            <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()"
               shiro:hasPermission="system:wcuser:remove">
                <i class="fa fa-remove"></i> 删除
            </a>
            <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="system:wcuser:export">
                <i class="fa fa-download"></i> 批量导出
            </a>
        </div>
        <div class="col-sm-12 select-table table-striped">
            <table id="bootstrap-table"></table>
        </div>
    </div>
</div>
<th:block th:include="include :: footer"/>

<script th:inline="javascript">

    var editFlag = [[${@permission.hasPermi('system:wcuser:edit')}]];
    var removeFlag = [[${@permission.hasPermi('system:wcuser:remove')}]];
    var prefix = ctx + "system/wcuser";

    $(function () {
     //   var list=[{id:0,name:"车友"},{id:1,name:"创客"},{id:2,name:"车商"},{id:3,name:"运营商"},{id:4,name:"风控商"},{id:5,name:"车源商"},{id:6,name:"车务商"}]
        // localStorage.setItem("list",JSON.stringify(list))
        // var parse = JSON.parse(localStorage.getItem('list'));

        var options = {
            pageSize: 25,
            pageList: [25, 50],
            url: prefix + "/list",
            createUrl: prefix + "/add",
            updateUrl: prefix + "/edit/{id}",
            removeUrl: prefix + "/remove",
            exportUrl: prefix + "/export",
            exportUrl4single: prefix + "/export4single",
            showSearch: false,
            showRefresh: false,
            showToggle: false,
            showColumns: false,
            search: true,
            modalName: "小程序端用户",
            columns: [{
                checkbox: true
            },
                // {
                //     field: 'id',
                //     title: 'ID',
                //     visible: true
                // },
                {
                    title: "序号",
                    formatter: function (value, row, index) {
                        return $.table.serialNumber(index);
                    }
                },
                {
                    field: 'realName',
                    title: '姓名'
                },
                {
                    field: 'mobile',
                    title: '电话'
                },
                {
                    field: 'forsysuserId',
                    title: '业务权限'
                },
                {
                    field: 'yname',
                    title: '推荐人姓名'
                },
                {
                    field: 'code',
                    title: '推荐人电话'
                },
                {
                    field: 'shangji',
                    title: '推荐人级别',
                    // formatter: function (value) {
                    //     return parse[value].name
                    // }
                },
                {
                    field: 'all',
                    title: '推荐总数'
                },
                {
                    field: 'cheyS',
                    title: '车友数'
                },
                {
                    field: 'chuangkS',
                    title: '创客数'
                },
                {
                    field: 'chesS',
                    title: '车商数'
                },
                {
                    field: 'yunyS',
                    title: '运营数'
                },
                // {
                //     field: 'gender',
                //     title: '性别'
                // },
                // {
                //     field: 'avatar',
                //     title: '微信头像'
                // },
                {
                    field: 'createTime',
                    title: '注册时间'
                },
                {
                    title: '操作',
                    align: 'center',
                    formatter: function (value, row, index) {
                        var actions = [];
                        actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> ');
                        actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a>');
                        // actions.push('<a class="btn btn-warning btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.export2excel(\'' + row.id + '\')"><i class="fa fa-download"></i>导出</a>');

                        return actions.join('');
                    }
                }]
        };

        $.table.init(options);
    });
</script>
</body>
</html>